package com.miao.service.Impl;

import com.miao.config.PayNotifyConfig;
import com.miao.po.MqMessage;
import com.miao.service.XcChooseCourseService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ReceiveMqMessage {

    @Autowired
    private XcChooseCourseService chooseCourseService;

    @RabbitListener(queues = PayNotifyConfig.PAYNOTIFY_QUEUE)
    public void processMqMessage(MqMessage mqMessage){
        //根据消息内容，更改选课记录表以及课程表
        String chooseId = mqMessage.getBusinessKey1();
        String orderType = mqMessage.getBusinessKey2();
        if(!orderType.equals("60201"))return;
        chooseCourseService.updateChaseCourse(chooseId);

    }



}
